// 书写商品相关的所有 api 接口
import request from '@/utils/requiest'

interface MyHotListParams {
  count?: number,
  limitNum?: number
}

// 1. 秒杀商品接口
export const hotListApi = (info: MyHotListParams) => request.get('/pro/seckilllist', {
  params: info
})

// 2. 热门搜索的接口
export const hotSearchApi = () => request.get('/pro/hotword')


//3模糊搜索接口
export const searchListApi = (keyword: string,count?:number)=> request.get('/pro/search',{
  params: {keyword: keyword}
}) 

//4获取商品列表
export const goodsListApi = (info:{count: number,limitNum?:number })=> request.get('/pro/list',{
  params: info
})

//5产品分类列表
export const categoryListApi =()=> request.get('/pro/categorylist')

//6产品分类下的品牌列表
export const cateBrandListApi = (cate:string)=> request.get('/pro/categorybrandlist',{
  params:
  {category: cate}
})
//7产品分类+品牌的接口
export const categoryBrandGoodsListApi = (info:{category:string,brand:string})=> request.get('/pro/categorybrandprolist',{
  params:info
})

//8.请求商品详细信息
export const getGoodsDetailApi = (id: string)=> request.get(`/pro/detail/${id}`)